import unittest
import re

from google.appengine.dist import use_library

use_library('django', '1.0')
from django.test.client import Client

class MyFirstTest(unittest.TestCase):
    def test_hello(self):
        print "Hello!!!"
        
    def test_is_logged_in(self):
        username = "Luisito"
        password = "12345"
        email = "luisito@cwpanama.net"
        
        namefinder = re.compile("<p>Hello (.*)</p>")
        
        c = Client()
        c.post('/member',{'name':username,'password':password,'email':email}).content
        content = c.get('/logintest').content
        matches = namefinder.search(content)
        self.assertEquals(matches.group(1), username)
        